package loop;

import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {

        System.out.println("输入一个数");
        Scanner  sc=new Scanner(System.in);
        int num=(int)(Math.random()*200);
        while(true)
        {
            int n=sc.nextInt();
            if (n>num)
                System.out.println("太大了,输小点试试");
            else if(n<num)
                System.out.println("太小了，输大点试试");
            else {
                System.out.println("答对了 答案是" + num);
                break;
            }
        }

    }
}
